//
//  BHHomeTitleBtn.m
//  xinlangweibo0621
//
//  Created by boldseas on 2017/6/22.
//  Copyright © 2017年 renbohan. All rights reserved.
//

#import "BHHomeTitleBtn.h"
#import <Masonry.h>

@implementation BHHomeTitleBtn

- (instancetype)initWithFrame:(CGRect)frame{
    self = [super initWithFrame:frame];
    
    self.titleLabel.font = [UIFont systemFontOfSize:20];
    [self setTitle:@"首页" forState:UIControlStateNormal];
    [self setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
    self.titleLabel.font = [UIFont systemFontOfSize:20];
    [self setImage:[UIImage imageNamed:@"navigationbar_arrow_down"] forState:UIControlStateNormal];
    [self setImage:[UIImage imageNamed:@"navigationbar_arrow_up"] forState:UIControlStateHighlighted];
    
    
    return self;
}

- (void)layoutSubviews{
    [super layoutSubviews];
    CGRect titleF = self.titleLabel.frame;
    CGRect imageF = self.imageView.frame;
    
    titleF.origin.x = self.imageView.frame.origin.x;
    imageF.origin.x = CGRectGetMaxX(self.titleLabel.frame) - 10;
    
    self.titleLabel.frame = titleF;
    self.imageView.frame = imageF;
}

@end
